import java.io.*;

// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        File f =new File("score.txt");
        Reader r = null;
        try{
             r = new FileReader(f);
        }catch (FileNotFoundException e){
            e.printStackTrace();
        }
        if(r != null){
            BufferedReader br = new BufferedReader(r);
            if(f.exists()){
                System.out.println("exist");
                try{
                    String line = br.readLine();
                    while((line = br.readLine())!=null){
                        System.out.println(line);
                        String[] strs = line.split("#");
                        int index =0;
                        int totalScore = 0;
                        for(String item :strs){
                            System.out.println(item);
                            if(index == 0){
                                index ++;
                                continue;
                            }else{
                                int score = Integer.parseInt(item);
                                totalScore+=score;
                            }
                        }
                        System.out.println(totalScore);
                    }
                }catch (IOException e){
                    e.printStackTrace();
                }
            }
        }
    }
}